package com.gitee.kinbug.sniper.common.enums;

import java.util.Arrays;

import lombok.Getter;

@Getter
public enum SymbolEnum {
	BTC("BTC-USDT",125,1,"30", 100),
	BCH("BCH-USDT",75,2,"0.3",800),
	LTC("LTC-USDT",75,2,"0.3",100),
	
	
	ETH("ETH-USDT",125,2,"3",500),
	BSV("BSV-USDT",75,2,"0.3",500),
	ETC("ETC-USDT",75,4,"0.003",500),
	XLM("XLM-USDT",75,6,"0.00003",100),
	TRX("TRX-USDT",75,6,"0.00003",100),
	
	DOT("DOT-USDT",75,4,"0.003",100),
	ADA("ADA-USDT",75,4,"0.003",100),
	ZEC("ZEN-USDT",75,4,"0.003",100),
	LINK("LINK-USDT",75,4,"0.003",100);
	private String code;
	private int rate;		//杠杆数
	private int precision;	//精度个数
	private String triggerPrice;//币对的触发价个差值
	private int capitalPool;//资金
	
	SymbolEnum(String code,int rate,int precision,String triggerPrice,int capitalPool){
		this.code = code;
		this.rate = rate;
		this.precision=precision;
		this.triggerPrice = triggerPrice;
		this.capitalPool = capitalPool;
	}
	
	public static SymbolEnum offer(String symbolStr) {
		return Arrays.stream(values()).filter(i -> symbolStr.contains(i.getCode())).findFirst().orElse(null);
	}
	
	public String getMarketMsg(CandleEnum candleEnum) {
		return "market." + this.getCode() + ".kline." + candleEnum.getCode();
	}
}
